package com.yxpweb.redisdao;

import com.yxpweb.mystarter.MystarterApplication;
import com.yxpweb.redisdao.dao.impl.UserDaoImpl;
import dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class RedisdaoApplication {

    public static void main(String[] args) {
        RedisdaoApplication redisdaoApplication = new RedisdaoApplication();
        System.out.println(redisdaoApplication.getClass().getClassLoader());
        ConfigurableApplicationContext run = SpringApplication.run(RedisdaoApplication.class, args);
        UserDaoImpl userDaoImpl = (UserDaoImpl) run.getBean("userDaoImpl");
        userDaoImpl.selectRedisKey();
        userDaoImpl.findMongoKey();

        MystarterApplication mystarterApplication = (MystarterApplication)run.getBean("mystarterApplication");
        mystarterApplication.mystartTest();
    }

}
